#!/bin/sh
. /lib/functions.sh

enabled=`uci -q get kuainiao.base.enabled`
[ "enabled" -eq 1 ] || exit 0
[ "$ACTION" = ifup ] && {
	logger -t Thunder kuainiao has reloaded due to Device: $DEVICE Action: $ACTION ;
	/etc/init.d/kuainiao stop && sleep 2;
	/etc/init.d/kuainiao start;
}

[ "$ACTION" = ifdown ] && {
	logger -t Thunder KuaiNiao has stoped due to Device: $DEVICE Action: $ACTION ;
	/etc/init.d/kuainiao stop;
}